//递归打印1,2,3,4
/*public class Test {*/
 /*   public static int num(int n) {
        int add = 0;
        if(n<10) {
            return n;
        }
        add += num(n);
        n /= 10;
        return add;
    }
    public static void main(String[] args) {
        int ret = num(123);
        System.out.println(ret);
    }*/
/*    public static void print(int n) {
        if(n<10) {
            System.out.println(n);
        } else {
            print(n/10);
            n %= 10;
            System.out.println(n);
          }
    }
    public static void main(String[] args) {
        print(123);
    }
}*/

import java.util.Scanner;

//输出n*n的乘法口诀表，n由用户输入。
public class Test {
    public static void table(int n) {
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(i+"*"+j+"="+i*j+" ");
            }
            System.out.println();
        }
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        table(n);
    }
}

//输出一个整数的每一位，如：123的每一位是3，2，1
/*
import java.util.Scanner;
public class Test {
    public static void negativeSequence(int a) {
        while(a != 0) {
            System.out.println(a%10);
            a /= 10;
        }
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        negativeSequence(a);//逆序
    }
}
*/


/*
编写代码模拟三次密码输入的场景。 最多能输入三次密码，密码正确，提示“登录成功”,密码错误，
可以重新输 入，最多输入三次。三次均错，则提示退出程序*/
/*import java.util.Scanner;
public class Test {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int count = 3;
        while(count != 0) {
            System.out.println("您共有"+count+"次机会输入密码");
            System.out.println("请输入：");
            String pss = scan.nextLine();
            if(pss.equals("123")) {
                System.out.println("登录成功！");
                break;
            } else {
                System.out.println("密码错误！");
                count--;
            }
        }
    }
}*/



//获取一个数二进制序列中所有的偶数位和奇数位， 分别输出二进制序列
/*import java.util.Scanner;
public class Test {
    public static void export(int a) {
        for (int i = 1; i <= 31; i += 2) {
            System.out.print(((a>>i) & 1) + " ");
        }//偶数
        System.out.println();
        for (int i = 0; i <= 30; i += 2) {
            System.out.print(((a>>i) & 1) + " ");
        }
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        export(a);
    }
}*/


